package hardy.etudejpa.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.hardy.util.objectutil.initial.Initial;
import org.hardy.util.objectutil.initial.InitialPolicy;
import hardy.hibhelper.basecore.sharding.SubKey;

@Entity
@Table(name = "user_auth", uniqueConstraints = {@UniqueConstraint(name = "USER_AUTH_PHONE", columnNames = {"PHONE"}),
@UniqueConstraint(name = "USER_AUTH_EMAIL", columnNames = {"EMAIL"})})
public class UserAuthEntity implements Serializable{
	private static final long serialVersionUID = 1L;
	@Id
	@Initial(policy = InitialPolicy.UUID_SIMPLE)
    private String userId;
    @Column(name = "PHONE", length = 32)
    @SubKey(columnName = "phone")
    private String phone;
    @Column(name = "EMAIL", length = 16)
    private String email;
    private String password;
    @Column(name = "REMARK",length = 16)
    private String remark;
    @Column(name = "ADD_DATE", nullable = false, columnDefinition = "datetime default now()")
    private Date addDate;
	
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Date getAddDate() {
		return addDate;
	}
	public void setAddDate(Date addDate) {
		this.addDate = addDate;
	}
	@Override
	public String toString() {
		return "UserAuthEntity [userId=" + userId + ", phone=" + phone + ", email=" + email + ", password=" + password
				+ ", remark=" + remark + ", addDate=" + addDate + "]";
	}
    
    
}
